# -*- coding:   utf-8 -*-
# @Time     :   2025-04-26 13:47   
# @Author   :   Kyln.Wu
# @WeChat   :   laonong-000
# @FileName :   api_test.py
# @IDE      :   PyCharm
import requests


def test_api():
    base_url = 'http://172.20.8.239'
    url = f'{base_url}:2531/v2/api/tools/getTokenId'
    # url = f'{base_url}:2531/v2/api/login/getLoginQrCode'
    # url = f'{base_url}:2531/v2/api/login/logout'
    # url = f'{base_url}:2531/v2/api/login/checkLoginQrCode'

    token = 'c1a1f20d079e4d5aa0e9f2f2490aeac8'

    headers = {'Content-Type': 'application/json', 'X-GEWE-TOKEN': token}
    data = {}
    res = requests.post(url, json=data, headers=headers)
    print(res.status_code)
    print(res.json())

    callback_url = f'{base_url}:9919/v2/api/tools/setCallback'
    """设置微信消息的回调地址"""
    param = {
        "token": token,
        "callbackUrl": callback_url
    }
    callback_response = requests.post(callback_url, json=param, headers=headers)
    print(callback_response.status_code)
    print(callback_response.json())


if __name__ == '__main__':
    test_api()

